package gob.pgr.digester;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class DateAdapter extends XmlAdapter<String, Date> {

	@Override
	public Date unmarshal(String v) throws Exception {
		return new SimpleDateFormat("dd/MM/yyyy").parse((String) v);
	}

	@Override
	public String marshal(Date v) throws Exception {
		return new SimpleDateFormat("dd/MM/yyyy").format((Date) v);
	}
	
}
